﻿using System.Collections.Generic;

namespace Core.DataAccess.ApiJson.SearchServiceProviders
{
    #region indexSchema Temp
    //new
    //{
    //    mappings = new
    //    {
    //        properties = new
    //        {
    //            name = new
    //            {
    //                type = "text"
    //            },
    //            age = new
    //            {
    //                type = "integer"
    //            },
    //            info = new
    //            {
    //                type = "text"
    //            },
    //            birthDay = new
    //            {
    //                type = "date"
    //            },
    //            location = new
    //            {
    //                type = "geo_point"
    //            }
    //        }
    //    }
    //}
    #endregion
    public class CreateIndexParameters
    {
        public IndexProperties mappings { get; set; }
        public Settings settings { get; set; } = new Settings();

    }

    public class IndexProperties
    {
        public Dictionary<string, PropertieType> properties { get; set; }
    }

    public class PropertieType
    {
        public PropertieType(string type)
        {
            this.type = type;
        }
        public string type { get; set; }
    }

    public class Settings
    {
        /// <summary>
        /// 分片数量
        /// </summary>
        public int number_of_shards { get; set; } = 3;
        /// <summary>
        /// 副本数量
        /// </summary>
        public int number_of_replicas { get; set; } = 2;
    }
}
